/* GUI CONVERTED from retrin1.p (converter v1.75) Sat Aug 12 23:09:49 2000 */
/* retrin1.p - REPETITIVE   TRANSACTION INPUT SUBPROGRAM                      */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/*F0PN*/ /*V8:ConvertMode=Maintenance                                         */
/*K1Q4*/ /*V8:RunMode=Character,Windows                                       */
/* REVISION: 7.3      LAST MODIFIED: 10/31/94   BY: WUG *GN77*                */
/* REVISION: 8.5      LAST MODIFIED: 05/12/95   BY: pma *J04T*                */
/* REVISION: 8.5      LAST MODIFIED: 05/01/96   BY: jym *G1MN*                */
/* REVISION: 8.6      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 11/17/99   BY: *N04H* Vivek Gogte        */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb                  */

         {mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

/*G1MN*/ {gpglefv.i}

         define output parameter undo_stat like mfc_logical no-undo.

/*J04T   define variable old_emp like emp.      */

/*N04H** {rewrsdef.i}                                                         */
         {retrform.i}

         undo_stat = yes.

         find mfc_ctrl where mfc_field = "rpc_using_new" no-lock no-error.
         if not available mfc_ctrl or mfc_logical = false then do:
            {mfmsg.i 5119 3}
            message.
            message.
            leave.
         end.

         display emp eff_date shift site with frame a.

/*G1MN*/ seta:
         do with frame a on error undo, retry:
/*GUI*/ if global-beam-me-up then undo, leave.

/*J04T      old_emp = emp.                      */

            set emp with frame a editing:
               {mfnp05.i emp_mstr emp_addr yes emp_addr "input frame a emp"}

               if recno <> ? then do:
                  display
                  emp_addr @ emp
                  emp_fname + " " + emp_lname @ ad_name.
               end.
            end.

            find emp_mstr where emp_addr = emp no-lock no-error.

            if not available emp_mstr then do:
               {mfmsg.i 520 3}
               undo , retry.
            end.

            if lookup(emp_status,"AC,PT") = 0 then do:
               {mfmsg.i 4027 3}
               undo , retry.
            end.

            display
            emp_addr @ emp
            emp_fname + " " + emp_lname @ ad_name.

            display eff_date shift.

            do with frame a on error undo , retry:
/*GUI*/ if global-beam-me-up then undo, leave.

               set eff_date shift site with frame a editing:
                  if frame-field = "site" then do:
                     {mfnp05.i si_mstr si_site yes si_site
                               "input frame a site"}

                     if recno <> ? then do:
                        display si_site @ site.
                     end.
                  end.
                  else do:
                     ststatus = stline[3].
                     status input ststatus.
                     readkey.
                     apply lastkey.
                  end.
               end.

               find si_mstr where si_site = site no-lock no-error.

               if not available si_mstr then do:
                  {mfmsg.i 708 3}
                  next-prompt site.
                  undo , retry.
               end.

/*J04T*/       {gprun.i ""gpsiver.p"" "(input site,
                                        input recid(si_mstr),
                                        output return_int)"
               }
/*GUI*/ if global-beam-me-up then undo, leave.

/*J04T*/       if return_int = 0 then do:
/*J04T*/          {mfmsg.i 725 3} /* USER DOES NOT HAVE ACCESS TO SITE */
/*J04T*/          next-prompt site.
/*J04T*/          undo, retry.
/*J04T*/       end.

/*G1MN*        {mfglef.i eff_date} */
/*G1MN*/                  {gpglef1.i &module = ""IC""
                                      &entity = si_entity
                                      &date   = eff_date
                                      &prompt = "eff_date"
                                      &frame  = "a"
                                      &loop   = "seta"}

            end.
/*GUI*/ if global-beam-me-up then undo, leave.


            undo_stat = no.
         end.
/*GUI*/ if global-beam-me-up then undo, leave.

